from scrapy.cmdline import execute
import sys
import os

# 把/develop/git_repo/ArticleSpider加入系统的Path中，以便能执行下面的命令
sys.path.append(os.path.dirname(os.path.abspath(__file__)))

# 相当于在命令行执行：
# (article) caibh@pc:/develop/git_repo/ArticleSpider$ scrapy crawl jobbole
execute(['scrapy', 'crawl', 'jobbole'])
# execute(['scrapy', 'crawl', 'lagou'])
